class Solution:
    def maximumScore(self, a: int, b: int, c: int) -> int:
        sum = 0
        abc_list = [a,b,c]
        min_val = min(a,b,c)
        sum += min_val
        abc_list.remove(min_val)
        max_val = max(abc_list)
        max_sub_min = max_val - min_val

        abc_list.remove(max_val)
        last = abc_list[0]
        min_val = min(last,max_sub_min)

        sum+=min_val

        return sum
## 成功版本
    def maximumScore1(self, a: int, b: int, c: int) -> int:
        abc_list = [a,b,c]
        abc_list.sort()
        one = abc_list[0]
        tow = abc_list[1]
        val = (a+b+c) // 2
        if one+tow < val:
            return one+tow
        return (a+b+c) // 2


if __name__ == '__main__':
    a,b,c = 4,4,6
    solution = Solution()
    val = solution.maximumScore(a,b,c)
    print(val)

    val = solution.maximumScore1(a,b,c)
    print(val)
